define(["jquery"],function($){
	$.fn.extend({
		fdj:function(obj1){
			var picbox = $("." + obj1.picbox),
			    fdj = $("." + obj1.fdj),
			    bigbox = $("." + obj1.bigbox),
			    bigpic = $("." + obj1.bigpic);
			    console.log(picbox[0])
		    picbox.mousemove(function(e){
		    	var _left = e.pageX - picbox.offset().left - fdj.width()/2,
		    		_top = e.pageY - picbox.offset().top - fdj.height()/2;
		    	if(_left < 0) _left = 0;
				if(_top < 0) _top = 0;
				if(_left > picbox.width() - fdj.width()) _left = picbox.width() - fdj.width();
				if(_top > picbox.height() - fdj.height()) _top = picbox.height() - fdj.height();
				fdj.css({"display":"inline-block","left":_left,"top":_top});
				bigbox.css("display","inline-block");
				
				bigpic.css({"left":-2*_left,"top":-2*_top})
		    })
		    picbox.mouseleave(function(){
		    	fdj.css("display","none");
		    	bigbox.css("display","none");
		    })
		}
	})
	
})
